/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
 *
 */

import { TaskNames } from '../../common/task-names.js';
import { PackageSharedTgz } from '../../hsp/package-shared-tgz.js';
import { ModuleTaskService } from '../../service/module-task-service.js';
import { TargetTaskService } from '../../service/target-task-service.js';
import { AbstractModuleHookTask } from '../abstract-module-hook-task.js';

import CommonHookTask = TaskNames.CommonHookTask;

/**
 * 组装Hsp打包的任务流
 *
 * @since 2023/1/17
 */
export class AssembleHsp extends AbstractModuleHookTask {
  constructor(moduleService: ModuleTaskService, isFaMode: boolean) {
    super(moduleService, isFaMode, CommonHookTask.ASSEMBLE_HSP);
  }

  initTaskDepends(taskTargetService: TargetTaskService) {
    const packageSharedTgz = `${taskTargetService.getTargetData().getTargetName()}@${PackageSharedTgz.name}`;
    this.dependsOn(packageSharedTgz);
  }
}
